﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace AdornerPopup.Sample
{
    public class NumberValidateRule : ValidationRule
    {
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            string str = value.ToString();
            bool valid = int.TryParse(str, out int _);
            return new ValidationResult(valid, valid ? "" : "Error number.");
        }
    }
}
